package com.trkj.dao.jpa;

import java.util.List;
import java.util.Map;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.trkj.pojos.CcCasrhistory;

public interface CcCasrhistoryDAO extends CrudRepository<CcCasrhistory, Long> {

	@Query("select  count(*) from CcCasrhistory c where c.inofficeid=?1")
	public long queryByinofficeid(String inofficeid);
	//
	@Query("select count(*) from CcCasrhistory c WHERE  to_char(c.admissiondate,'yyyy-mm')=?1 ")
	public long queryByadmissiondate(String strdate);
	
	@Query("select c from CcCasrhistory c order by c.outdate desc")
	public List<CcCasrhistory> queryByCcCasrhistory(Pageable pageable);
	@Query("select c from CcCasrhistory c where c.casepatientid=?1 order by c.outdate desc")
	public List<CcCasrhistory> queryBycasepatientid(String casepatientid);
	
	
}
